<!--
 售后前台录入
 -->
<template>
  <div>
    <el-row>
      <el-button-group>
        <el-button type="info" :size='size' @click="addShow" :disabled="toggleShow">新增</el-button>

        <el-button type="success" :size='size' @click="save">保存</el-button>

      </el-button-group>

      <!-- 修改下拉框 -->
    </el-row>

    <!-- 新增 -->
    <el-row v-if="toggleShow">
      <el-divider></el-divider>
      <!-- 改成行类表单  :inline="true"  -->
      <el-form ref="form1" :inline="true" :rules="rules" :model="form" label-width="80px">
        <!-- 用br换行 或者div  -->
        <el-form-item label="日期">
          <el-date-picker style="width: 200px;" :size="size" v-model="time1" type="datetime" disabled>
          </el-date-picker>
        </el-form-item>

        <el-row :gutter="20">       <!-- 第一列 -->
          <el-col :span="3.5">
            <el-form-item label="服务顾问">
              <el-input style="width: 170px;" disabled :size="size" v-model="form.fuwuguwen"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="3.5" :offset="1">
            <el-form-item label="维修班组" prop="enter">
              <el-select @change="banzu" style="width: 170px;" :size="size" v-model="form.weixiuGroup" placeholder="请选择">
                <el-option v-for="item in options3" :key="item.id" :label="item.name" :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="3.5" :offset="1">
            <el-form-item label="维修技师" prop="jishi">
              <el-select style="width: 170px;" :size="size" v-model="form.weixiuPerson" placeholder="请选择">
                <el-option v-for="item in jishis" :key="item.id" :label="item.name" :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="3.5" :offset="1">
            <el-form-item style="" label="车牌号码">
              <el-input style="width: 170px;" :size="size" v-model="form.chePaiNum"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="3.5" :offset="1">
            <el-form-item label="车龄">
              <el-input style="width: 170px;" :size="size" v-model="form.cheLing"></el-input>
            </el-form-item>
          </el-col>
          </el-row>


          <el-row :gutter="20">           <!-- 第二列 -->
           <el-col :span="3.5">
            <el-form-item label="能源类型">
                <el-select style="width: 170px;" :size="size" v-model="form.nengYuan" placeholder="请选择">
                  <el-option v-for="item in options2" :key="item.value" :label="item.nengYuan" :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="3.5" :offset="1">
              <el-form-item label="保险天数">
                <el-input style="width: 170px;" :size="size" v-model="form.baoXian" :step="1" :min="0">
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="3.5" :offset="1">
              <el-form-item label="外协公司">
                <el-select clearable style="width: 170px;" :size="size" v-model="form.waixieCompany" placeholder="请选择">
                  <el-option v-for="item in waixieCompanys" :key="item.value" :label="item.name" :value="item.name">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="3.5" :offset="1">
              <el-form-item label="外协成本">
                <el-input style="width: 170px;" :size="size" v-model="form.waixieCost"></el-input>
              </el-form-item>
            </el-col>
          <el-col :span="3.5" :offset="1">
            <el-form-item label="保养套餐:" prop="baoYang">
              <el-select clearable style="width: 170px;" v-model="form.maiBaoYang" placeholder="请选择" :size="size"
                 >
                <el-option v-for="item in zengBaoYang1" :key="item.value" :label="item.name" :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          </el-row>


          <el-row :gutter="20">
            <el-col :span="3.5" >
              <el-form-item label="精品名称:" prop="zengBaoYang">
                <el-select clearable style="width: 170px;" v-model="form.maiJingPin" placeholder="请选择" :size="size"
                   >
                  <el-option v-for="item in zengJingPin1" :key="item.value" :label="item.name" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="3.5" :offset="1">
              <el-form-item label="延保名称:" prop="zengBaoYang">
                <el-select clearable style="width: 170px;" v-model="form.maiYanBao" placeholder="请选择" :size="size"
                   >
                  <el-option v-for="item in zengYanBao1" :key="item.value" :label="item.name" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="3.5" :offset="1">
              <el-form-item label="洗美名称:" prop="zengBaoYang">
                <el-select clearable style="width: 170px;" v-model="form.maiXiMei" placeholder="请选择" :size="size"
                 >
                  <el-option v-for="item in zengXiMei1" :key="item.value" :label="item.name" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="9" :offset="1">
              <el-form-item label="车型" >
                <el-select style="width: 170px;" :size="size" v-model="form.chePinPai" placeholder="请选择" @change="che">
                  <el-option v-for="item in options4" :key="item.value" :label="item.chePinPai" :value="item.value">
                  </el-option>
                </el-select>

                <el-input :size="size" style="width: 170px;" v-if="waipin" v-model="form.cheXing"></el-input>
                <el-select :size="size" style="width: 170px;" v-if="benpin" v-model="form.cheXing">
                  <el-option v-for="item in cars" :key="item.value" :label="item.name" :value="item.name">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
          <el-col :span="18">
            <el-form-item  label="保险公司:" prop="zengBaoXian">
              <el-select clearable @change="zengbaoxian"  v-model="form.maiBaoXian" placeholder="请选择" :size="size" clearable>
                <el-option v-for="item in zengBaoXian1" :key="item.value" :label="item.name" :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item style="padding-left: 3%;" label="交强险" prop="zengJiaoQiangXian">
              <el-input-number :size="size" style="width: 170px;" :controls="false"  controls-position="right" :disabled="!form.maiBaoXian" :step="0.1" :min="0"
                :precision="2" v-model="form.maiJiaoQiang"> </el-input-number>
            </el-form-item>
            <el-form-item label="商业险" style="padding-left: 7%;" prop="zengShangYeXian">
              <el-input-number :size="size" style="width: 170px;" :controls="false" controls-position="right" :disabled="!form.maiBaoXian" :step="0.1" :min="0"
                :precision="2" v-model="form.maiShangYeXian"> </el-input-number>
            </el-form-item>
          </el-col>
          </el-row>
          <el-row>
            <el-form-item label="车牌公司:" prop="maiChePai">
              <el-select @change="maichepai" v-model="form.maiChePai" placeholder="请选择" :size="size" clearable>
                <el-option v-for="item in zengChePai" :key="item.value" :label="item.name" :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item prop="xiaoShouChePai" >
              <el-input-number :size="size" :controls="false" controls-position="right" :disabled="!form.maiChePai" :step="0.1" :min="0"
                :precision="2" v-model="form.xiaoShouChePai"> </el-input-number>
            </el-form-item>


        </el-row>
        <el-divider></el-divider>
        <p>请选择保养类别</p>
        <el-row type="flex" justify="center" style="padding-left: 2%;">

          <el-col :span="6">
            <el-checkbox label="首保" @change="shoubao"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!shoubao1"
              v-model="form.shoubaoGongshi" @change="shoubaoP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="定保" @change="dingbao"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!dingbao1"
              v-model="form.dingbaoGongshi" @change="dingbaoP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="首保配件" @change="sbpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="配件收入" :size="size" :disabled="!sbpj1"
              v-model="form.shoubaoPeijian" @change="sbpjP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="定保配件" @change="dbpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="配件收入" :size="size" :disabled="!dbpj1"
              v-model="form.dingbaoPeijian" @change="dbpjP"></el-input-number>
          </el-col>
        </el-row>

        <el-row type="flex" justify="center" style="padding-top: 20px;padding-left: 2%;">
          <el-col :span="6">
            <el-checkbox label="免保" @change="mianbao"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!mianbao1"
              v-model="form.mianbaoGongshi" @change="mianbaoP"></el-input-number>
          </el-col>

          <el-col :span="6">
            <el-checkbox label="套餐" @change="taocan"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!taocan1"
              v-model="form.taocanGongshi" @change="taocanP"></el-input-number>
          </el-col>

          <el-col :span="6">
            <el-checkbox label="免保配件" @change="mbpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="配件收入" :size="size" :disabled="!mbpj1"
              v-model="form.mianbaoPeijian" @change="mbpjP"></el-input-number>
          </el-col>

          <el-col :span="6">
            <el-checkbox label="套餐配件" @change="tcpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="配件收入" :size="size" :disabled="!tcpj1"
              v-model="form.taocanPeijian" @change="tcpjP"></el-input-number>
          </el-col>
        </el-row>
        <el-row type="flex" justify="space-around" style="padding-top: 20px;">
          <el-col :span="6">
            <span style="margin-left: 30px;">保养类别工时收入</span>
            <el-input-number :controls="false" :min="0" placeholder="保养工时收入" :size="size" v-model="form.baoYangPrice" disabled>
            </el-input-number>
          </el-col>
          <el-col :span="6">
            <span>保养类别配件收入</span>
            <el-input-number :controls="false" :min="0" placeholder="保养工时收入" :size="size" v-model="form.baoYangpeijianPrice"
              disabled></el-input-number>
          </el-col>
        </el-row>

        <el-divider></el-divider>
        <p>请选择机电类别</p>
        <el-row type="flex" justify="center" style="padding-left: 2%;">

          <el-col :span="6">
            <el-checkbox label="维修" @change="weixiu"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!weixiu1"
              v-model="form.weixiuGongshi" @change="weixiuP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="索赔&召回" @change="suopei"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!suopei1"
              v-model="form.suopeiGongshi" @change="suopeiP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="维修配件" @change="wxpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="配件收入" :size="size" :disabled="!wxpj1"
              v-model="form.weixiuPeijian" @change="wxpjP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="索赔&召回配件" @change="sphzhpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="配件收入" :size="size" :disabled="!sphzhpj1"
              v-model="form.suopeiPeijian" @change="sphzhpjP"></el-input-number>
          </el-col>
        </el-row>

        <el-row type="flex" justify="center" style="padding-top: 20px;padding-left: 2%;">
          <el-col :span="6">
            <el-checkbox label="免检" @change="mianjian"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!mianjian1"
              v-model="form.mianjianGongshi" @change="mianjianP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="事故" @change="shigu"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 40px;" placeholder="工时收入" :size="size"
              :disabled="!shigu1" v-model="form.shiguGongshi" @change="shiguP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="免检配件" @change="mjpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="配件收入" :size="size" :disabled="!mjpj1"
              v-model="form.mianjianPeijian" @change="mjpjP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="事故配件" @change="sgpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 40px;" placeholder="配件收入" :size="size"
              :disabled="!sgpj1" v-model="form.shiguPeijian" @change="sgpjP"></el-input-number>
          </el-col>
        </el-row>
        <el-row type="flex" justify="center" style="padding-top: 20px;padding-left: 2%;">
          <el-col :span="6">
            <el-checkbox label="PDI" @change="pdi"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 45px;" placeholder="工时收入" :size="size"
              :disabled="!pdi1" v-model="form.pdiGongshi" @change="pdiP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="PDI配件" @change="pdipj"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 5px;" placeholder="配件收入" :size="size"
              :disabled="!pdipj1" v-model="form.pdiPeijian" @change="pdipjP"></el-input-number>
          </el-col>
        </el-row>
        <el-row type="flex" justify="space-around" style="padding-top: 20px;">
          <el-col :span="6">
            <span>机电类别工时收入</span>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" v-model="form.jidianPrice" disabled>
            </el-input-number>
          </el-col>
          <el-col :span="6">
            <span>机电类别配件收入</span>
            <el-input-number :controls="false" :min="0" placeholder="配件收入" :size="size" v-model="form.jidianPeijianPrice"
              disabled></el-input-number>
          </el-col>
        </el-row>
        <el-divider></el-divider>
        <p>请选择钣喷类别</p>
        <el-row type="flex" justify="space-around" style="padding-left: 2%;">
          <el-col :span="6">
            <el-checkbox label="保险钣金&油漆" @change="bxbjhyq"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!bxbjhyq1"
              v-model="form.bxbjyqGongshi" @change="bxbjhyqP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="保险钣金" @change="bxbj"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 40px;" placeholder="工时收入" :size="size"
              :disabled="!bxbj1" v-model="form.bxbjGongshi" @change="bxbjP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="保险钣金&油漆配件" style="" @change="bxbjhyqpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="配件收入" :size="size" :disabled="!bxbjhyqpj1"
              v-model="form.bxbjyqPeijian" @change="bxbjhyqpjP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="保险钣金配件" @change="bxbjpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 40px;" placeholder="配件收入" :size="size"
              :disabled="!bxbjpj1" v-model="form.bxbjPeijian" @change="bxbjpjP"></el-input-number>
          </el-col>
        </el-row>
        <el-row type="flex" justify="center" style="padding-top: 20px;padding-left: 2%;">
          <el-col :span="6">
            <el-checkbox label="保险油漆" @change="bxyq"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 40px;" placeholder="工时收入" :size="size"
              :disabled="!bxyq1" v-model="form.bxyqGongshi" @change="bxyqP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="自费钣金&油漆" @change="zfbjhyq" style=""></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!zfbjhyq1"
              v-model="form.zfbjyqGongshi" @change="zfbjhyqP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="保险油漆配件" @change="bxyqpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 40px;" placeholder="配件收入" :size="size"
              :disabled="!bxyqpj1" v-model="form.bxyqPeijian" @change="bxyqpjP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="自费钣金&油漆配件" style="" @change="zfbjhyqpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="配件收入" :size="size" :disabled="!zfbjhyqpj1"
              v-model="form.zfbjyqPeijian" @change="zfbjhyqpjP"></el-input-number>
          </el-col>
        </el-row>
        <el-row type="flex" justify="center" style="padding-top: 20px;padding-left: 2%;">
          <el-col :span="6">
            <el-checkbox label="自费钣金" @change="zfbj"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 40px;" placeholder="工时收入" :size="size"
              :disabled="!zfbj1" v-model="form.zfbjGongshi" @change="zfbjP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="自费油漆" @change="zfyq"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 40px;" placeholder="工时收入" :size="size"
              :disabled="!zfyq1" v-model="form.zfyqGongshi" @change="zfyqP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="自费钣金配件" style="" @change="zfbjpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 40px;" placeholder="配件收入" :size="size"
              :disabled="!zfbjpj1" v-model="form.zfbjPeijian" @change="zfbjpjP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="自费油漆配件" style="" @change="zfyqpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 40px;" placeholder="配件收入" :size="size"
              :disabled="!zfyqpj1" v-model="form.zfyqPeijian" @change="zfyqpjP"></el-input-number>
          </el-col>
        </el-row>
        <el-row type="flex" justify="center" style="padding-top: 20px;padding-left: 2%;">
          <el-col :span="6">
            <el-checkbox label="索赔&召回" @change="sp"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 28px;" placeholder="工时收入" :size="size"
              :disabled="!sp1" v-model="form.spGongshi" @change="spP"></el-input-number>
          </el-col>
          <el-col :span="6">
            <el-checkbox label="索赔&召回配件" @change="bpsphzhpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" style="padding-left: 28px;" placeholder="配件收入" :size="size"
              :disabled="!bpsphzhpj1" v-model="form.spPeijian" @change="bpsphzhpjP"></el-input-number>
          </el-col>
        </el-row>
        </el-col>
        <el-row type="flex" justify="space-around" style="padding-top: 20px;">
          <el-col :span="6">
            <span>钣喷类别工时收入</span>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" v-model="form.banpenPrice" disabled>
            </el-input-number>
          </el-col>
          <el-col :span="6">
            <span>钣喷类别配件收入</span>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" v-model="form.banpenPeijianPrice"
              disabled></el-input-number>
          </el-col>
        </el-row>
        <el-divider></el-divider>
        <p>请选择洗美类别</p>
        <el-row type="flex" justify="space-around" :gutter="40" style="padding-top: 20px;padding-left: 2%;">
          <el-col :span="4.8">
            <el-checkbox label="洗车" @change="xiche"></el-checkbox>
            <el-input-number style="padding-left: 30px;" :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!xiche1"
              v-model="form.xicheGongshi" @change="xicheP"></el-input-number>
          </el-col>
          <el-col :span="4.8">
            <el-checkbox label="美容" @change="meirong"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!meirong1"
              v-model="form.meirongGongshi" @change="meirongP"></el-input-number>
          </el-col>
          <el-col :span="4.8">
            <el-checkbox label="加装" @change="jiazhuang"></el-checkbox>
            <el-input-number style="padding-left: 30px;" :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!jiazhuang1"
              v-model="form.jiazhuangGongshi"  @change="jiazhuangP"></el-input-number>
          </el-col>
          <el-col :span="4.8">
            <el-checkbox label="代办年审" @change="dbns"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!dbns1"
              v-model="form.dbnsGongshi" @change="dbnsP"></el-input-number>
          </el-col>
          <el-col :span="4.8">
            <span style="padding-left: 20px;">洗美类别工时收入</span>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" disabled v-model="form.ximeiPrice"
              disabled></el-input-number>
          </el-col>
        </el-row>

        <el-row type="flex"  :gutter="40" style="padding-top: 20px;padding-left: 2%;">


          <el-col :span="4.8" >
            <el-checkbox label="美容配件" @change="mrpj"></el-checkbox>
            <el-input-number :controls="false" :min="0" placeholder="工时收入" :size="size" :disabled="!mrpj1"
              v-model="form.meirongPeijian" @change="mrpjP"></el-input-number>
          </el-col>

          <el-col :span="4.8" :push="4">
            <el-checkbox label="加装配件" @change="jzpj" style=" padding-left: 22px;"></el-checkbox>
            <el-input-number :controls="false" placeholder="工时收入" :size="size" :disabled="!jzpj1"
              v-model="form.jiazhuangPeijina" @change="jzpjP"></el-input-number>
          </el-col>


          <el-col :span="4.8" :push="8">
            <span style=" padding-left: 68px;">洗美类别配件收入</span>
            <el-input-number :controls="false" placeholder="工时收入" :size="size" disabled v-model="form.ximeiPeijianPrice"
              disabled></el-input-number>
          </el-col>


        </el-row>
        <el-divider></el-divider>
        <p>请选择配件类别</p>
        <el-row type="flex" justify="space-around" :gutter="40" style="padding-top: 20px;">
          <el-col :span="6">
        <el-checkbox label="油液类" style="width: 70px;" @change="youye" 　></el-checkbox>
        <el-input-number :controls="false" :min="0" placeholder="金额" style="width: 180;" :size="size" v-model="form.youLeiPrice"
          :disabled="!youye1" @change="youyeP"></el-input-number>
         </el-col>
        <el-col :span="6">
        <el-checkbox label="零件" style="width: 70px;" 　@change="lingjian"></el-checkbox>
        <el-input-number :controls="false" :min="0" style="width: 180;" placeholder="金额" :size="size"
          v-model="form.lingJianPrice" :disabled="!lingjian1" @change="lingjianP"></el-input-number>
        </el-col>
        <el-col :span="6">
        <el-checkbox label="养护品"  style="width: 100px;"　 @change="yanghu"></el-checkbox>
        <el-input-number :controls="false" :min="0" style="width: 180;" placeholder="金额" :size="size" v-model="form.yanghuPrice"
          :disabled="!yanghu1" @change="yanghuP"></el-input-number>
         </el-col>
        <el-col :span="6">
        <el-checkbox label="精品" style="width: 95px;" @change="jingpin"></el-checkbox>
        <el-input-number :controls="false" style="width: 180;" placeholder="金额" :size="size"
          v-model="form.jingpinPrice" :min="0" :disabled="!jingpin1" @change="jingpinP"></el-input-number>
        </el-col>
        </el-row>
        <el-row type="flex" justify="space-around" :gutter="40" style="padding-top: 20px;">
        <el-col :span="6">
        <el-checkbox label="轮胎" 　style="width: 70px;"  @change="luntai"></el-checkbox>
        <el-input-number :controls="false" :min="0" style="width: 180;" placeholder="金额" :size="size" v-model="form.lunTaiPrice"
          :disabled="!luntai1" @change="luntaiP"></el-input-number>
        </el-col>
        <el-col :span="6">
        <el-checkbox label="漆类" style="width: 70px;" @change="youqi"></el-checkbox>
        <el-input-number :controls="false" :min="0" style="width: 180;" placeholder="金额" :size="size" v-model="form.qiPrice"
          :disabled="!youqi1" @change="youqiP"></el-input-number>
        </el-col>
        <el-col :span="6">
        <el-checkbox label="低值易耗品" style="width: 100px;"　 @change="dzyxhp"></el-checkbox>
        <el-input-number :controls="false":min="0" style="width: 180;" placeholder="金额" :size="size"
          v-model="form.dizhiyihaoPrice" :disabled="!dzyxhp1" @change="dzyxhpP"></el-input-number>
        </el-col>
        <el-col :span="6">
        <span >配件类别金额</span>
        <el-input-number :controls="false" style="width: 180;" placeholder="金额" :size="size"
          v-model="form.peijianPrice" disabled></el-input-number>
        </el-col>
         </el-row>
      </el-form>
      <el-divider></el-divider>
    </el-row>
  </div>
</template>

<script>
  export default {
    inject: ['reload'],
    data() {
      return {
        zengChePai:[],
      zengJingPin1: [],
      zengBaoYang1: [],
      zengYanBao1: [],
      zengXiMei1: [],
      zengBaoXian1: [],
        jishis: [],
        shoubao1: false, //首保

        dingbao1: false, //定保

        mianbao1: false, //免保

        taocan1: false, //套餐

        weixiu1: false, //维修
        suopei1: false, //索赔
        mianjian1: false, //免检
        shigu1: false, //事故
        pdi1: false, //PDI

        bxbjhyq1: false, //保险钣金和油漆
        bxbj1: false, //保险钣金
        bxyq1: false, //保险油漆
        zfbjhyq1: false, //自费钣金和油漆
        zfbj1: false, //自费钣金
        zfyq1: false, //自费油漆
        sp1: false, //索赔和召回

        xiche1: false, //洗车
        meirong1: false, //美容
        jiazhuang1: false, //加装
        dbns1: false, //代办年审

        youye1: false, //油液
        lingjian1: false, //零件
        yanghu1: false, //养护品
        jingpin1: false, //精品
        luntai1: false, //轮胎
        youqi1: false, //漆类
        dzyxhp1: false, //低值易消耗品

        wxpj1: false, //维修配件
        sphzhpj1: false, //维修和召回配件
        mjpj1: false, //免检配件
        sgpj1: false, //事故配件
        pdipj1: false, //pdi配件

        sbpj1: false, //首保配件
        dbpj1: false, //定保配件
        mbpj1: false, //免保配件
        tcpj1: false, //套餐配件

        bxbjhyqpj1: false, //保险钣金&油漆配件
        bxbjpj1: false, //保险板件配件
        bxyqpj1: false, //保险油漆配件
        zfbjhyqpj1: false, //自费板件&油漆配件
        zfbjpj1: false, //自费板件配件
        zfyqpj1: false, //自费油漆配件
        bpsphzhpj1: false, //索赔&召回配件

        mrpj1: false, //美容配件
        jzpj1: false, //加装配件
        peijianzongPrice: '', //保养钣喷机电洗美配件总收入
        size: 'medium',
        waixieCompanys: {},
        cars: {},
        //切换新增修改显示
        toggleShow: true,
        time1: '',
        waipin: false,
        benpin: false,
        form: {
          xiaoShouChePai:0,
          maiChePai:'',
          maiBaoYang:'',
          maiJingPin:'',
          maiYanBao:'',
          maiXiMei:'',
          maiBaoXian:'',
          maiJiaoQiang:0,
          maiShangYeXian:0,
          date: '', //售后前台录入窗口录入时间
          chePaiNum: '', //车牌号
          fuwuguwen: '', //维修顾问
          weixiuGroup: '', //维修班组
          weixiuPerson: '', //维修技师
          chePinPai: '', //车型品牌
          cheXing: '', //车型
          cheLing: '', //车龄
          nengYuan: '', //能源类型
          baoXian: '', //保险天数

          weixiuClass: '', //维修类别

          peijianClass: '', //配件类别名称
          baoyangClass: '', //保养类别名称
          jidianClass: '', //机电类别名称
          banpenClass: '', //钣喷类别名称
          ximeiClass: '', //洗美类别名称
          /* 保养类别 */
          shoubaoGongshi: '', //首保工时收入
          shoubaoPeijian: '', //首保配件价格

          dingbaoGongshi: '', //定保工时收入
          dingbaoPeijian: '', //定保配件价格

          mianbaoGongshi: '', //免保工时收入
          mianbaoPeijian: '', //免保配件价格

          taocanGongshi: '', //套餐工时收入
          taocanPeijian: '', //套餐配件价格
          /* 机电类别 */
          weixiuGongshi: '', //维修工时收入
          weixiuPeijian: '', //维修配件价格

          suopeiGongshi: '', //机电索赔和召回工时收入
          suopeiPeijian: '', //机电索赔和召回配件价格

          mianjianGongshi: '', //免检工时收入
          mianjianPeijian: '', //免检配件价格

          shiguGongshi: '', //事故工时收入
          shiguPeijian: '', //事故配件价格

          pdiGongshi: '', //PDI工时收入
          pdiPeijian: '', //PDI配件价格
          /* 钣喷类别 */
          bxbjyqGongshi: '', //保养钣金&油漆工时收入
          bxbjyqPeijian: '', //保养钣喷&油漆配件价格

          bxbjGongshi: '', //保险钣金工时收入
          bxbjPeijian: '', //保险钣金配件价格

          bxyqGongshi: '', //保险油漆工时收入
          bxyqPeijian: '', //保险油漆配件价格

          zfbjyqGongshi: '', //自费钣金油漆工时收入
          zfbjyqPeijian: '', //自费钣金油漆配件价格

          zfbjGongshi: '', //自费钣金工时收入
          zfbjPeijian: '', //自费钣金配件价格

          zfyqGongshi: '', //自费油漆工时收入
          zfyqPeijian: '', //自费油漆配件价格

          spGongshi: '', //钣喷索赔&召回工时收入
          spPeijian: '', //钣喷索赔&召回配件价格
          /* 洗美类别 */
          xicheGongshi: '', //洗车工时收入
          meirongGongshi: '', //美容工时收入
          meirongPeijian: '', //美容配件价格
          jiazhuangGongshi: '', //加装工时收入
          jiazhuangPeijina: '', //加装配件价格
          dbnsGongshi: '', //代办年审工时收入

          youLeiPrice: '', //油液类价格
          lingJianPrice: '', //零件价格
          yanghuPrice: '', //养护品价格
          jingpinPrice: '', //精品价格
          lunTaiPrice: 0, //轮胎价格
          qiPrice: '', //漆类价格
          dizhiyihaoPrice: '', //低值易耗品价格

          peijianPrice: '', //配件总收入

          baoYangPrice: '', //保养类别工时收入
          jidianPrice: '', //机电类别工时收入
          banpenPrice: '', //钣喷类别工时收入
          ximeiPrice: '', //洗美类别工时收入

          baoYangpeijianPrice: '', //保养配件收入
          jidianPeijianPrice: '', //机电配件收入
          banpenPeijianPrice: '', //钣喷配件收入
          ximeiPeijianPrice: '', //洗美配件价格

          gongshiPrice: 0, //工时总收入


          waixieCompany: '', //外协公司
          waixieCost: '', //外协成本


          chePinPai: '',
          cheXing: ''
        },
        //修改下拉框的值
        options: {},
        //修改下拉框选择之后存的值
        value: '',
        //能源类型
        options3: [{
          value: '班组一',
          label: '班组一'
        }, {
          value: '班组二',
          label: '班组二',
        }],
        options2: [{
          value: '燃油车',
          label: '燃油车'
        }, {
          value: '新能源车',
          label: '新能源车',
        }],
        options4: [{
          value: '外品牌',
          label: '外品牌',
        }, {
          value: '本品牌',
          label: '本品牌',
        }],
        rules: {},
        user: {}
      }
    },
    methods: {
      maichepai(i){
        console.log(i)
        if(i==''){
         this.form.xiaoShouChePai=0
        }
      },
      getCarNumber() { //获得车牌公司
        this.$ajax.post('CarNumberCompany/list', {}).then(res => {
          var result = res.data
          this.$set(this, "zengChePai", result.data)
          this.showTree = false
          this.$nextTick(() => {
            this.showTree = true;
          });
        })
      },
      shoubao(a) { //显示首保金额输入
        this.shoubao1 = a
        this.form.shoubaoGongshi = 0
        this.getBaoyangPrice() //算出保养类别工时总收入
      },
      shoubaoP(a) { //得到首保金额
        this.form.shoubaoGongshi = a
        this.getBaoyangPrice() //算出保养类别工时总收入
      },
      dingbao(a) { //显示定保金额输入
        this.dingbao1 = a
        this.form.dingbaoGongshi = 0
        this.getBaoyangPrice() //算出保养类别工时总收入
      },
      dingbaoP(a) { //得到定保金额
        this.form.dingbaoGongshi = a
        this.getBaoyangPrice() //算出保养类别工时总收入
      },
      mianbao(a) { //显示免保金额输入
        this.mianbao1 = a
        this.form.mianbaoGongshi = 0
        this.getBaoyangPrice() //算出保养类别工时总收入
      },
      mianbaoP(a) { //得到免保金额
        this.form.mianbaoGongshi = a
        this.getBaoyangPrice() //算出保养类别工时总收入
      },
      taocan(a) { //显示套餐金额输入
        this.taocan1 = a
        this.form.taocanGongshi = 0
        this.getBaoyangPrice() //算出保养类别工时总收入
      },
      taocanP(a) { //得到套餐金额
        this.form.taocanGongshi = a
        this.getBaoyangPrice() //算出保养类别工时总收入
      },
      weixiu(a) { //显示维修金额输入
        this.weixiu1 = a
        this.form.weixiuGongshi = 0
        this.getJidianPrice()
      },
      weixiuP(a) { //得到维修金额
        this.form.weixiuGongshi = a
        this.getJidianPrice()
      },
      suopei(a) { //显示索赔&召回金额输入
        this.suopei1 = a
        this.form.suopeiGongshi = 0
        this.getJidianPrice()
      },
      suopeiP(a) { //得到索赔&召回金额
        this.form.suopeiGongshi = a
        this.getJidianPrice()
      },
      mianjian(a) { //显示免检金额输入
        this.mianjian1 = a
        this.form.mianjianGongshi = 0
        this.getJidianPrice()
      },
      mianjianP(a) { //得到免检金额
        this.form.mianjianGongshi = a
        this.getJidianPrice()
      },
      shigu(a) { //显示事故金额输入
        this.shigu1 = a
        this.form.shiguGongshi = 0
        this.getJidianPrice()
      },
      shiguP(a) {
        this.form.shiguGongshi = a
        this.getJidianPrice()
      },
      pdi(a) { //显示PDI金额输入
        this.pdi1 = a
        this.form.pdiGongshi = 0
        this.getJidianPrice()
      },
      pdiP(a) { //得到PDI金额
        this.form.pdiGongshi = a
        this.getJidianPrice()
      },
      bxbjhyq(a) { //显示保险钣金&油漆金额输入
        this.bxbjhyq1 = a
        this.form.bxbjyqGongshi = 0
        this.getBanpenPrice()
      },
      bxbjhyqP(a) {
        this.form.bxbjyqGongshi = a
        this.getBanpenPrice()
      },
      bxbj(a) { //显示保险钣金金额输入
        this.bxbj1 = a
        this.form.bxbjGongshi = 0
        this.getBanpenPrice()
      },
      bxbjP(a) {
        this.form.bxbjGongshi = a
        this.getBanpenPrice()
      },
      bxyq(a) { //显示保险油漆金额输入
        this.bxyq1 = a
        this.form.bxyqGongshi = 0
        this.getBanpenPrice()
      },
      bxyqP(a) {
        this.form.bxyqGongshi = a
        this.getBanpenPrice()
      },
      zfbjhyq(a) { //显示自费钣金&油漆金额输入
        this.zfbjhyq1 = a
        this.form.zfbjyqGongshi = 0
        this.getBanpenPrice()
      },
      zfbjhyqP(a) {
        this.form.zfbjyqGongshi = a
        this.getBanpenPrice()
      },
      zfbj(a) { //显示自费钣金金额输入
        this.zfbj1 = a
        this.form.zfbjGongshi = 0
        this.getBanpenPrice()
      },
      zfbjP(a) {
        this.form.zfbjGongshi = a
        this.getBanpenPrice()
      },
      zfyq(a) { //显示自费油漆金额输入
        this.zfyq1 = a
        this.form.zfyqGongshi = 0
        this.getBanpenPrice()
      },
      zfyqP(a) {
        this.form.zfyqGongshi = a
        this.getBanpenPrice()
      },
      sp(a) { //显示索赔&召回金额输入
        this.sp1 = a
        this.form.spGongshi = 0
        this.getBanpenPrice()
      },
      spP(a) {
        this.form.spGongshi = a
        this.getBanpenPrice()
      },
      xiche(a) { //显示洗车金额输入
        this.xiche1 = a
        this.form.xicheGongshi = 0
        this.getXimeiPrice()
      },
      xicheP(a) {
        this.form.xicheGongshi = a
        this.getXimeiPrice()
      },
      meirong(a) { //显示美容金额输入
        this.meirong1 = a
        this.form.meirongGongshi = 0
        this.getXimeiPrice()
      },
      meirongP(a) {
        this.form.meirongGongshi = a
        this.getXimeiPrice()
      },
      jiazhuang(a) { //显示加装金额输入
        this.jiazhuang1 = a
        this.form.jiazhuangGongshi = 0
        this.getXimeiPrice()
      },
      jiazhuangP(a) {
        this.form.jiazhuangGongshi = a
        this.getXimeiPrice()
      },
      dbns(a) { //显示代办年审金额输入
        this.dbns1 = a
        this.form.dbnsGongshi = 0
        this.getXimeiPrice()
      },
      dbnsP(a) {
        this.form.dbnsGongshi = a
        this.getXimeiPrice()
      },
      wxpj(a) { //维修配件
        this.wxpj1 = a
        this.form.weixiuPeijian = 0
        this.getjidianpjPrice() //算出机电类别配件收入
      },
      wxpjP(a) {
        this.form.weixiuPeijian = a
        this.getjidianpjPrice() //算出机电类别配件收入
      },
      sphzhpj(a) { //索赔&召回配件
        this.sphzhpj1 = a
        this.form.suopeiPeijian = 0
        this.getjidianpjPrice() //算出机电类别配件收入
      },
      sphzhpjP(a) {
        this.form.suopeiPeijian = a
        this.getjidianpjPrice() //算出机电类别配件收入
      },
      mjpj(a) { //免检配件
        this.mjpj1 = a
        this.form.mianjianPeijian = 0
        this.getjidianpjPrice() //算出机电类别配件收入
      },
      mjpjP(a) {
        this.form.mianjianPeijian = a
        this.getjidianpjPrice() //算出机电类别配件收入
      },
      sgpj(a) { //事故配件
        this.sgpj1 = a
        this.form.shiguPeijian = 0
        this.getjidianpjPrice() //算出机电类别配件收入
      },
      sgpjP(a) {
        this.form.shiguPeijian = a
        this.getjidianpjPrice() //算出机电类别配件收入
      },
      pdipj(a) { //PDI配件
        this.pdipj1 = a
        this.form.pdiPeijian = 0
        this.getjidianpjPrice() //算出机电类别配件收入
      },
      pdipjP(a) {
        this.form.pdiPeijian = a
        this.getjidianpjPrice() //算出机电类别配件收入
      },

      dbpj(a) { //定保配件
        this.dbpj1 = a
        this.form.dingbaoPeijian = 0
        this.getBaoyangpjPrice() //计算保养类别配件收入
      },
      dbpjP(a) {
        this.form.dingbaoPeijian = a
        this.getBaoyangpjPrice()
      },
      sbpj(a) { //首保配件
        this.sbpj1 = a
        this.form.shoubaoPeijian = 0
        this.getBaoyangpjPrice() //计算保养类别配件收入
      },
      sbpjP(a) {
        this.form.shoubaoPeijian = a
        this.getBaoyangpjPrice() //计算保养类别配件收入
      },
      mbpj(a) { //免保配件
        this.mbpj1 = a
        this.form.mianbaoPeijian = 0
        this.getBaoyangpjPrice() //计算保养类别配件收入
      },
      mbpjP(a) {
        this.form.mianbaoPeijian = a
        this.getBaoyangpjPrice() //计算保养类别配件收入
      },
      tcpj(a) { //套餐配件
        this.tcpj1 = a
        this.form.taocanPeijian = 0
        this.getBaoyangpjPrice() //计算保养类别配件收入
      },
      tcpjP(a) {
        this.form.taocanPeijian = a
        this.getBaoyangpjPrice() //计算保养类别配件收入
      },

      bxbjhyqpj(a) { //保险钣金&油漆配件
        this.bxbjhyqpj1 = a
        this.form.bxbjyqPeijian = 0
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      bxbjhyqpjP(a) {
        this.form.bxbjyqPeijian = a
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      bxbjpj(a) { //保险钣金配件
        this.bxbjpj1 = a
        this.form.bxbjPeijian = 0
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      bxbjpjP(a) {
        this.form.bxbjPeijian = a
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      bxyqpj(a) { //保险油漆
        this.bxyqpj1 = a
        this.form.bxyqPeijian = 0
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      bxyqpjP(a) {
        this.form.bxyqPeijian = a
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      zfbjhyqpj(a) { //自费板件&油漆配件
        this.zfbjhyqpj1 = a
        this.form.zfbjyqPeijian = 0
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      zfbjhyqpjP(a) {
        this.form.zfbjyqPeijian = a
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      zfbjpj(a) { //自费钣金配件
        this.zfbjpj1 = a
        this.form.zfbjPeijian = 0
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      zfbjpjP(a) {
        this.form.zfbjPeijian = a
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      zfyqpj(a) { //自费油漆配件
        this.zfyqpj1 = a
        this.form.zfyqPeijian = 0
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      zfyqpjP(a) {
        this.form.zfyqPeijian = a
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },

      bpsphzhpj(a) {
        this.bpsphzhpj1 = a
        this.form.spPeijian = 0
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },
      bpsphzhpjP(a) {
        this.form.spPeijian = a
        this.getBanpenpjPrice() //计算钣喷类配件收入
      },

      youye(a) { //油漆类
        this.youye1 = a
        this.form.youLeiPrice = 0
        this.getpeijianPrice() //配件总收入
      },
      youyeP(a) {
        this.form.youLeiPrice = a
        this.getpeijianPrice() //配件总收入
      },

      lingjian(a) { //零件
        this.lingjian1 = a
        this.form.lingJianPrice = 0
        this.getpeijianPrice() //配件总收入
      },
      lingjianP(a) {
        this.form.lingJianPrice = a
        this.getpeijianPrice() //配件总收入
      },
      yanghu(a) { //养护品
        this.yanghu1 = a
        this.form.yanghuPrice = 0
        this.getpeijianPrice() //配件总收入
      },
      yanghuP(a) {
        this.form.yanghuPrice = a
        this.getpeijianPrice() //配件总收入
      },
      jingpin(a) { //精品
        this.jingpin1 = a
        this.form.jingpinPrice = 0
        this.getpeijianPrice() //配件总收入
      },
      jingpinP(a) {
        this.form.jingpinPrice = a
        this.getpeijianPrice() //配件总收入
      },
      luntai(a) { //轮胎
        this.luntai1 = a
        this.form.lunTaiPrice = 0
        this.getpeijianPrice() //配件总收入
      },
      luntaiP(a) {
        this.form.lunTaiPrice = a
        this.getpeijianPrice() //配件总收入
      },
      youqi(a) { //漆类
        this.youqi1 = a
        this.form.qiPrice = 0
        this.getpeijianPrice() //配件总收入
      },
      youqiP(a) {
        this.form.qiPrice = a
        this.getpeijianPrice() //配件总收入
      },
      dzyxhp(a) { //低值易消耗品
        this.dzyxhp1 = a
        this.form.dizhiyihaoPrice = 0
        this.getpeijianPrice() //配件总收入
      },
      dzyxhpP(a) {
        this.form.dizhiyihaoPrice = a
        this.getpeijianPrice() //配件总收入
      },

      mrpj(a) {
        this.mrpj1 = a
        this.form.meirongPeijian = 0
        this.getximeiPeijianPrice()
      },
      mrpjP(a) {
        this.form.meirongPeijian = a
        this.getximeiPeijianPrice()
      },
      jzpj(a) {
        this.jzpj1 = a
        this.form.jiazhuangPeijina = 0
        this.getximeiPeijianPrice()
      },
      jzpjP(a) {
        this.form.jiazhuangPeijina = a
        this.getximeiPeijianPrice()
      },



      che(a) {
        if (a === "本品牌") {
          this.benpin = true
          this.waipin = false
          this.getCar()
        } else {
          this.waipin = true
          this.benpin = false
        }
      },
      getdatatime() { //默认显示今天
        this.time1 = new Date();
      },
      //切换v-if
      addShow() {
        console.log(this.form);
        this.toggleShow = true
        emptyObj(this.form)
        this.value = '';
      },

      //保存
      save() {
        this.getgongshiPrice()
        this.getpeijianzongPrice()
        this.getbaoyangClass() //保养类别名称
        this.getpeijianClass() //配件类别名称
        this.getjidianClass() //机电类别名称
        this.getbanpenClass() //钣喷类别名称
        this.getximeiClass() //洗美类别名称
        if (this.peijianzongPrice == this.form.peijianPrice) {
          this.$refs.form1.validate(valid => {
            if (valid) {
              this.form.date = this.time1;
              this.$ajax.post("afterSalefront2/save", this.form).then(res => {
                var result = res.data;
                if (result.success) {
                  this.$notify({
                    title: '提示',
                    message: '数据保存成功',
                    type: 'success',
                    position: 'bottom-right'
                  });
                  emptyObj(this.form)
                  this.value = '';
                }
              })
            }
          })
          /* location. reload() */
          this.reload()
        } else {
          this.$notify({
            title: '提示',
            message: '配件总和不符合',
            type: 'warning',
            position: 'bottom-right'
          });
        }
      },
      getuser() { //得到员工信息
        this.$ajax.post('user/getuser', {}).then(res => {
          var result = res.data
          this.user = result.data
          this.form.fuwuguwen = this.user.name
        })
      },
      getCar() { //获取车型
        this.$ajax.post('newCar/list', {}).then(res => {
          var result = res.data
          this.$set(this, "cars", result.data)
          this.showTree = false
          this.$nextTick(() => {
            this.showTree = true;
          });
        })
      },

      getWaixie() { //得到外协公司
        this.$ajax.post("Outsource/list", {}).then(res => {
          var result = res.data
          this.waixieCompanys = result.data
        })
      },
      getbanZu() {
        this.$ajax.post("user/banzu", {}).then(res => {
          this.options3 = res.data.data
        })
      },
      banzu(id) {
        this.form.weixiuPerson = ""
        this.$ajax.post("user/findByBanZu", {
          "id": id
        }).then(res => {
          this.jishis = res.data.data
        })
      },
      getximeiPeijianPrice() { //洗美配件总价格
        this.form.ximeiPeijianPrice = this.form.meirongPeijian + this.form.jiazhuangPeijina
      },
      getBaoyangPrice() { //算出保养类别工时总收入
        this.form.baoYangPrice = this.form.shoubaoGongshi + this.form.dingbaoGongshi + this.form.mianbaoGongshi + this
          .form
          .taocanGongshi
      },
      getBaoyangpjPrice() {
        this.form.baoYangpeijianPrice = this.form.shoubaoPeijian + this.form.dingbaoPeijian + this.form.mianbaoPeijian +
          this.form.taocanPeijian
      },

      getJidianPrice() { //机电类别工时收入
        this.form.jidianPrice = this.form.weixiuGongshi + this.form.suopeiGongshi + this.form.mianjianGongshi + this
          .form
          .shiguGongshi +
          this.form.pdiGongshi
      },
      getjidianpjPrice() { ////算出机电类别配件收入
        this.form.jidianPeijianPrice = this.form.weixiuPeijian + this.form.suopeiPeijian + this.form.mianjianPeijian +
          this.form.shiguPeijian + this.form.pdiPeijian
      },

      getBanpenPrice() { //钣喷类别工时收入
        this.form.banpenPrice = this.form.bxbjyqGongshi + this.form.bxbjGongshi + this.form.bxyqGongshi + this.form
          .zfbjyqGongshi +
          this.form.zfbjGongshi + this.form.zfyqGongshi +
          this.form.spGongshi
      },
      getBanpenpjPrice() { //钣喷类配件收入
        this.form.banpenPeijianPrice = this.form.bxbjyqPeijian + this.form.bxbjPeijian + this.form.bxyqPeijian + this
          .form
          .zfbjyqPeijian + this.form.zfbjPeijian +
          this.form.zfyqPeijian +
          this.form.spPeijian
      },
      getpeijianzongPrice() { //保养钣喷机电洗美配件总收入
        this.peijianzongPrice = this.form.baoYangpeijianPrice + this.form.jidianPeijianPrice + this.form
          .banpenPeijianPrice +
          this.form.ximeiPeijianPrice
      },
      getpeijianPrice() { //配件总收入
        this.form.peijianPrice = this.form.youLeiPrice + this.form.lingJianPrice + this.form.jingpinPrice +
          this.form.lunTaiPrice + this.form.qiPrice + this.form.dizhiyihaoPrice + this.form.yanghuPrice
      },

      getXimeiPrice() { //洗美类别工时收入
        this.form.ximeiPrice = this.form.xicheGongshi + this.form.meirongGongshi + this.form.jiazhuangGongshi + this
          .form
          .dbnsGongshi
      },
      getgongshiPrice() { //计算工时总收入
        this.form.gongshiPrice = this.form.baoYangPrice + this.form.jidianPrice + this.form.banpenPrice + this.form
          .ximeiPrice
      },

      getbaoyangClass() { //保养类别名称
        if (this.shoubao1 == true) {
          this.form.baoyangClass = "首保"
        }
        if (this.dingbao1 == true) {
          this.form.baoyangClass = this.form.baoyangClass + ",定保"
        }
        if (this.mianbao1 == true) {
          this.form.baoyangClass = this.form.baoyangClass + ",免保"
        }
        if (this.taocan1 == true) {
          this.form.baoyangClass = this.form.baoyangClass + ",套餐"
        }

      },
      getpeijianClass() { //配件类别名称
        if (this.youye1 == true) {
          this.form.peijianClass = "油液类"
        }
        if (this.lingjian1 == true) {
          this.form.peijianClass = this.form.peijianClass + ",零件"
        }
        if (this.yanghu1 == true) {
          this.form.peijianClass = this.form.peijianClass + ",养护品"
        }
        if (this.jingpin1 == true) {
          this.form.peijianClass = this.form.peijianClass + ",精品"
        }
        if (this.luntai1 == true) {
          this.form.peijianClass = this.form.peijianClass + ",轮胎"
        }
        if (this.youqi1 == true) {
          this.form.peijianClass = this.form.peijianClass + ",漆类"
        }
        if (this.dzyxhp1 == true) {
          this.form.peijianClass = this.form.peijianClass + ",低值易耗品"
        }
      },
      getjidianClass() { //机电类别名称
        if (this.weixiu1 == true) {
          this.form.jidianClass = "维修"
        }
        if (this.suopei1 == true) {
          this.form.jidianClass = this.form.jidianClass + ",索赔&召回"
        }
        if (this.mianjian1 == true) {
          this.form.jidianClass = this.form.jidianClass + ",免检"
        }
        if (this.shigu1 == true) {
          this.form.jidianClass = this.form.jidianClass + ",事故"
        }
        if (this.pdi1 == true) {
          this.form.jidianClass = this.form.jidianClass + ",PDI"
        }
      },
      getbanpenClass() { //钣喷类别名称
        if (this.bxbjhyq1 == true) {
          this.form.banpenClass = "保险钣金&油漆"
        }
        if (this.bxbj1 == true) {
          this.form.banpenClass = this.form.banpenClass + ",保险钣金"
        }
        if (this.bxyq1 == true) {
          this.form.banpenClass = this.form.banpenClass + ",保险油漆"
        }
        if (this.zfbjhyq1 == true) {
          this.form.banpenClass = this.form.banpenClass + ",自费钣金&油漆"
        }
        if (this.zfbj1 == true) {
          this.form.banpenClass = this.form.banpenClass + ",自费钣金"
        }
        if (this.zfyq1 == true) {
          this.form.banpenClass = this.form.banpenClass + ",自费油漆"
        }
        if (this.sp1 == true) {
          this.form.banpenClass = this.form.banpenClass + ",索赔&召回"
        }
      },
      getximeiClass() { //洗美类别名称
        if (this.xiche1 == true) {
          this.form.ximeiClass = "洗车"
        }
        if (this.meirong1 == true) {
          this.form.ximeiClass = this.form.ximeiClass + ",美容"
        }
        if (this.jiazhuang1 == true) {
          this.form.ximeiClass = this.form.ximeiClass + ",加装"
        }
        if (this.dbns1 == true) {
          this.form.ximeiClass = this.form.ximeiClass + ",代办年审"
        }
      },
   getSaleCarKeep() { //获得保养
      this.$ajax.post('CarKeep/list', {}).then(res => {
        var result = res.data
        this.$set(this, "zengBaoYang1", result.data)
        this.showTree = false
        this.$nextTick(() => {
          this.showTree = true;
        });
      })
    },
    getSaleBoutique() { //获取精品
      this.$ajax.post('saleBoutique/list', {}).then(res => {
        var result = res.data
        this.$set(this, "zengJingPin1", result.data)
        this.showTree = false
        this.$nextTick(() => {
          this.showTree = true;
        });
      })
    },
    getSaleYanBao() { //获得延保
      this.$ajax.post('yanbao2/list', {}).then(res => {
        var result = res.data
        this.$set(this, "zengYanBao1", result.data)
        this.showTree = false
        this.$nextTick(() => {
          this.showTree = true;
        });
      })
    },
    getXiMei() { //获得洗美
      this.$ajax.post('ximei2/list', {}).then(res => {
        var result = res.data
        this.$set(this, "zengXiMei1", result.data)
        this.showTree = false
        this.$nextTick(() => {
          this.showTree = true;
        });
      })
    },
    getBaoXian() { //获得保险
      this.$ajax.post('Insurance2/list', {}).then(res => {
        var result = res.data
        this.$set(this, "zengBaoXian1", result.data)
        this.showTree = false
        this.$nextTick(() => {
          this.showTree = true;
        });
      })
    },
    zengbaoxian(i) {

      if (i == '') {
        this.form.maiJiaoQiang = 0
        this.form.maiShangYeXian = 0
      }
    },
    shuaxin(){
      this.getdatatime();
      this.getuser();
      this.getWaixie();
      this.getbanZu();
      this.getSaleCarKeep();
      this.getBaoXian();
      this.getXiMei();
      this.getSaleYanBao();
      this.getSaleBoutique();
      this.getCarNumber();
    }
    },

    /*      //选择下拉框
          editChange() {
            this.$ajax.post("afterSalefront2/findbyId", {
              id: this.value
            }).then(res => {
              var result = res.data;
              if (result.success) {
                this.form = result.data;
              }
            })
          },
          //点击下拉框×
          qingkong() {
            this.value = '';

          }, */
    /*    }, */


    created() {
     this.shuaxin()
    }
  }

  function emptyObj(obj) {
    if (obj.file) {
      obj.file = ""
    }
    for (var key in obj) {
      var o = obj[key];
      if (o instanceof Object) {
        emptyObj(o);
      } else {
        obj[key] = '';
      }
    }
  }
</script>

<style scoped>
  .el-input {
    width: 10%;
  }
</style>
